package c.f.c.a.j;

import c.f.c.a.d;
import c.f.c.a.f;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutionException;

public final class h {

    public static class a<TResult> implements Object, d {
        public final CountDownLatch a = new CountDownLatch(1);

        public final void onFailure(Exception exception) {
            this.a.countDown();
        }

        public final void onSuccess(TResult tResult) {
            this.a.countDown();
        }
    }

    public static <TResult> TResult a(f<TResult> fVar) throws ExecutionException {
        if (fVar.g()) {
            return fVar.f();
        }
        throw new ExecutionException(fVar.e());
    }
}
